<?php
class Wechat_login_test{
    /**
     * 测试微信授权
     */
    public function get(){
        if(!isset($_SESSION['wechat_userinfo'])){
            $url = urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
            header('Location:/wechat/login?url='.$url);
        }else{
            dump($_SESSION['wechat_userinfo']);
        }
    }
}